package com.demo.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public final class pro {
	private   static  String ftpId;    
	private   static  Integer ftpPort; 
    private   static  String ftpUser;
    private   static  String ftpPwd; 
    private   static  String urlPath;
 
    static String path ="/com/demo/info.properties";
    static  {    
       Properties prop =  new  Properties();    
        try{
        	InputStream in = pro.class.getResourceAsStream(path);
        	prop.load( in);
        	ftpId = prop.getProperty( "ftp.id" ).trim();
        	ftpPort = Integer.parseInt(prop.getProperty( "ftp.port" ).trim());
        	ftpUser = prop.getProperty("ftp.username").trim();
        	ftpPwd = prop.getProperty("ftp.password").trim();
        	urlPath = prop.getProperty("url.path").trim();
	       }catch  (IOException e) {    
	           e.printStackTrace();    
	    }
   }
 
    /**    
    * 私有构造方法，不需要创建对象    
    */     
    private pro() {
	}   
	public static String getFtpId() {
		return ftpId;
	}
	public static Integer getFtpPort() {
		return ftpPort;
	}
	public static String getFtpUser() {
		return ftpUser;
	}
	public static String getFtpPwd() {
		return ftpPwd;
	}
	
	 public static String getUrlPath() {
		return urlPath;
	}
	public   static   void  main(String args[]){    
	       System.out.println(getFtpId());    
	       System.out.println(getFtpPort());    
	       System.out.println(getFtpUser());    
	       System.out.println(getFtpPwd());    
	       System.out.println(getUrlPath());    
	       System.out.println(System.getProperty("user.dir"));
	   }
	
	
}
